package com.zuoyeben123.testzybhtml.protocol;

import android.util.Log;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class TextTpMessage extends TpPackage {
	private String str; 
	public TextTpMessage(String str) {
		this.str = str;
		super.init();
	}

	@Override
	byte[] initData() {
		if(str != null) {
			try {
				byte[] data = str.getBytes("UTF-8");
				Log.d("WLTest", "str:" + str + ", data:" + Arrays.toString(data));
				return data;
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}
		return null;
	}

}
